package com.winkyle.woodenfish.controller.fragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.winkyle.woodenfish.R;
import com.winkyle.woodenfish.databinding.FragmentTeamBinding;
import com.winkyle.woodenfish.factory.presenterfactory.CreatePresenter;
import com.winkyle.woodenfish.mvpview.TeamView;
import com.winkyle.woodenfish.presenter.TeamPresenter;

/**
 * @author winkyle
 * @date 2018/06/20
 * @description 继承自 {@link AbstractMvpFragment}的碎片类TeamFragment，app的团队页
 */
@CreatePresenter(value = TeamPresenter.class)
public class TeamFragment extends AbstractMvpFragment<TeamView,TeamPresenter> implements TeamView {
    private FragmentTeamBinding fragmentTeamBinding;
    /**
     * @description 碎片创建，指定layout布局
     * @param inflater
     * @param container
     * @param savedInstanceState 保存的碎片状态的数据
     * @return
     */
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_team, container, false);
        fragmentTeamBinding = DataBindingUtil.bind(view);
        initFragment();
        return view;
    }


    /**
     * @description 初始化碎片的一些数据和动作
     * @return
     */
    private void initFragment() {
        fragmentTeamBinding.setTeamView(this);
    }

}
